package pers.zxk.jlytnews.dao;

import pers.zxk.jlytnews.entity.News;

import java.sql.SQLException;
import java.util.List;

public interface NewsDao {
    //添加本地新闻
    public boolean addNews(int type, String title, String icon, String url, String contents, String date, String source) throws SQLException, ClassNotFoundException;
    //通过id删除新闻
    public boolean delNews(int id) throws SQLException, ClassNotFoundException;
    //通过id更新新闻
    public boolean updateNews(int id, int type, String title, String icon, String url, String contents, String date, String source) throws SQLException, ClassNotFoundException;
    //通过id获取新闻
    public News getNews(int id) throws SQLException, ClassNotFoundException;
    //返回最近发布的新闻列表,count<=0返回全部新闻
    public List<News> getLatestNews(int count) throws SQLException, ClassNotFoundException;

    public List<News> getNewsList(int page,int size) throws SQLException, ClassNotFoundException;

    public List<News> getNewsListPlus(int page,int size) throws SQLException, ClassNotFoundException;
}
